﻿<UserControl x:Class="Starehe.Views.HomePage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" Background="White"
    xmlns:viewModels ="clr-namespace:Starehe.ViewModels"
                xmlns:views ="clr-namespace:Starehe.Views"
      xmlns:controls="clr-namespace:Helper.Controls;assembly=Starehe.Helper"
     d:DesignHeight="724" d:DesignWidth="1022">

    <UserControl.Resources>
        <SolidColorBrush x:Key="TitleBackgroundBrush" Color="{DynamicResource Title0BackgroundColor}"/>
    </UserControl.Resources>

    <Grid Name="mainGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="140"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- Back button and page title -->
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="120"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Border Grid.ColumnSpan="2" Background="{DynamicResource TitleBackgroundBrush}"/>

            <TextBlock x:Name="pageTitle" Text="Starehe" Style="{StaticResource HeaderTextStyle}" Grid.Column="1" HorizontalAlignment="Left"
                        IsHitTestVisible="false" TextWrapping="NoWrap" VerticalAlignment="Bottom" Margin="0,0,30,40"/>

        </Grid>

        <Grid Grid.Row="1">
            <Grid Margin="125,10,0,0" HorizontalAlignment="Left" Width="782" Height="564" Name="groupLinks" VerticalAlignment="Top">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <controls:HomePageButton Grid.Column="0" Grid.Row="0" Caption="Students" 
                    Command="{Binding Path=DataContext.DisplayStudentsCommand, RelativeSource={RelativeSource AncestorType=views:MainWindow}}"
                                         CaptionBackground="{DynamicResource Title1BackgroundBrush}">
                    <controls:HomePageButton.Content>
                        <Image Stretch="UniformToFill" Source="/Starehe;component/Resources/students_bg.jpg"/>
                    </controls:HomePageButton.Content>
                </controls:HomePageButton>

                <controls:HomePageButton Grid.Column="1" Grid.Row="0" Caption="Staff"
                                         Command="{Binding Path=DataContext.DisplayStaffCommand, RelativeSource={RelativeSource AncestorType=views:MainWindow}}"
                                         CaptionBackground="{DynamicResource Title2BackgroundBrush}">
                    <controls:HomePageButton.Background>
                        <ImageBrush ImageSource="/Starehe;component/Resources/teacher_bg.jpg"/>
                    </controls:HomePageButton.Background>
                </controls:HomePageButton>

                <controls:HomePageButton Grid.Column="2" Grid.Row="0" Caption="Fees" Background="Khaki"
                                         Command="{Binding Path=DataContext.DisplayFeesCommand, RelativeSource={RelativeSource AncestorType=views:MainWindow}}"
                                         CaptionBackground="{DynamicResource Title3BackgroundBrush}">
                    <controls:HomePageButton.Content>
                        <Image Stretch="UniformToFill" Source="/Starehe;component/Resources/finance_bg.jpg"/>
                    </controls:HomePageButton.Content>
                </controls:HomePageButton>

                <controls:HomePageButton Grid.Column="0" Grid.Row="1" Caption="School"
                                         Command="{Binding Path=DataContext.DisplaySchoolCommand, RelativeSource={RelativeSource AncestorType=views:MainWindow}}"
                                         CaptionBackground="{DynamicResource Title4BackgroundBrush}">
                    <controls:HomePageButton.Background>
                        <ImageBrush ImageSource="/Starehe;component/Resources/school_bg.jpg"/>
                    </controls:HomePageButton.Background>
                </controls:HomePageButton>

                <controls:HomePageButton Grid.Column="1" Grid.Row="1" Caption="Timetable"
                                         Command="{Binding Path=DataContext.DisplayTimeTableCommand, RelativeSource={RelativeSource AncestorType=views:MainWindow}}"
                                         CaptionBackground="{DynamicResource Title5BackgroundBrush}">
                    <controls:HomePageButton.Background>
                        <ImageBrush ImageSource="/Starehe;component/Resources/shedule_bg.jpg"/>
                    </controls:HomePageButton.Background>
                </controls:HomePageButton>

                <controls:HomePageButton Grid.Column="2" Grid.Row="1" Caption="Exams"
                                         Command="{Binding Path=DataContext.DisplayExamsCommand, RelativeSource={RelativeSource AncestorType=views:MainWindow}}"
                                         CaptionBackground="{DynamicResource Title6BackgroundBrush}">
                    <controls:HomePageButton.Background>
                        <ImageBrush ImageSource="/Starehe;component/Resources/exam_bg.jpg"/>
                    </controls:HomePageButton.Background>
                </controls:HomePageButton>

                <controls:HomePageButton Grid.Column="0" Grid.Row="2" Caption="Events" Background="#8FD400"
                    Command="{Binding Path=DataContext.DisplayEventsCommand, RelativeSource={RelativeSource AncestorType=views:MainWindow}}"
                                         CaptionBackground="{DynamicResource Title7BackgroundBrush}">
                    <controls:HomePageButton.Content>
                        <Image Stretch="UniformToFill" Source="/Starehe;component/Resources/events_bg.jpg"/>
                    </controls:HomePageButton.Content>
                </controls:HomePageButton>

                <controls:HomePageButton Grid.Column="1" Grid.Row="2" Caption="Gallery"
                                         Command="{Binding Path=DataContext.DisplayGalleryCommand, RelativeSource={RelativeSource AncestorType=views:MainWindow}}"
                                         CaptionBackground="{DynamicResource Title8BackgroundBrush}">
                    <controls:HomePageButton.Background>
                        <ImageBrush ImageSource="/Starehe;component/Resources/gallery_bg.jpg"/>
                    </controls:HomePageButton.Background>
                </controls:HomePageButton>

                <controls:HomePageButton Grid.Column="2" Grid.Row="2" Caption="Settings"
                                         Command="{Binding Path=DataContext.DisplaySettingsCommand, RelativeSource={RelativeSource AncestorType=views:MainWindow}}"
                                         CaptionBackground="{DynamicResource Title9BackgroundBrush}">
                    <controls:HomePageButton.Background>
                        <ImageBrush ImageSource="/Starehe;component/Resources/settings_bg.jpg"/>
                    </controls:HomePageButton.Background>
                </controls:HomePageButton>

            </Grid>
            <TextBlock HorizontalAlignment="Left" Margin="17,42,0,0" Text="{Binding ElementName=mainGrid, Path=ActualHeight, StringFormat=Height {0}}" VerticalAlignment="Top" Foreground="Black"/>
            <TextBlock HorizontalAlignment="Left" Margin="17,60,0,0" Text="{Binding ElementName=mainGrid, Path=ActualWidth, StringFormat=Width {0}}" VerticalAlignment="Top" Foreground="Black"/>
            <TextBlock HorizontalAlignment="Left" Margin="17,80,0,0" Text="{Binding ElementName=groupLinks, Path=ActualHeight, StringFormat=Height {0}}" VerticalAlignment="Top" Foreground="Black"/>
        </Grid>
    </Grid>
</UserControl>
      